package com.cm.stock.manager.service;

import com.cm.stock.manager.dao.PointVenteDAO;
import com.cm.stock.manager.dto.PointVenteDTO;

public class PointVenteService {
	
	private PointVenteDAO pointventeDAO;
	
	public PointVenteDTO getPointVenteByCode(String code){
		return pointventeDAO.getByCode(code);
	}
	
	public PointVenteDTO savePointVente(String description, String name){
		String code = pointventeDAO.getMaxId()+"";
		return pointventeDAO.save(new PointVenteDTO(code, description, name));
	}
	
	public PointVenteDTO updatePointVente(PointVenteDTO pointvente){
		return pointventeDAO.update(pointvente);
	}
	
	public void deletePointVente (Integer id) throws Exception{
		pointventeDAO.deleteOne(id);
	}

	public void setPointventeDAO(PointVenteDAO pointventeDAO) {
		this.pointventeDAO = pointventeDAO;
	}
	
	

}
